package com.huatai.exchange.send;

import com.faneui.common.exception.BusinessException;
import com.faneui.common.utils.ListUtils;
import com.huatai.exchange.AbstractService;
import com.huatai.exchange.integration.base.service.CommunicationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;

public abstract class AbstractFileSendServiceImpl extends AbstractService implements FileSendService {

    @Autowired
    protected CommunicationService communicationService;

    @Value("${monitor_mail}")
    protected String monitorMail;

    @Override
    public void checkCommunicationIsFinish(String businId) throws BusinessException {
        if(StringUtils.isBlank(businId))
            return;
        if(ListUtils.isNotEmpty(communicationService.queryMail(businId)))
            throw new BusinessException("任务组装完成，发送中") ;
    }
}
